#pragma once
#include <atomic>
#include <QObject>
#include <QVariant>
#include <QTimer>
#include <QNetworkAccessManager>
#include <QMutexLocker>

class xxWorker: public QObject
{
	Q_OBJECT
	
public:
	xxWorker(QObject* parent = nullptr);
	~xxWorker();

	Q_INVOKABLE void init();
	Q_INVOKABLE void uninit();

	void getResult();  // 获取worker中返回的值

private:
	void xxWorkFunc();

private:
	QTimer* m_timer = {nullptr};
	QMutex mutex;
	std::atomic<bool>   m_runService = { false };
};

